1 Imports System.IO
2 Public Class frmChangePass
3
4 #Region
"Controlbox"
5
6     Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
7         Me.Close()
8     End Sub
9
10 #End Region
11
12     Private Sub Btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btncancel.Click
13         Me.Close()
14     End Sub
15
16     Private Sub frmChangePass_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
17         Dim reader As New StreamReader(Application.StartupPath &
"\pass.dat")
18         txtPass.Text = reader.Readline
19         reader.Close()
20     End Sub
21
22     Private Sub BtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSave.Click
23         Dim writer As New StreamWriter(Application.StartupPath &
"\pass.dat")
24         writer.writeline(txtPass.Text)
25         writer.Close()
26         Me.Close()
27     End Sub
28 End Class


Gõ tìm kiếm nhanh...